Ext.define("Oa.view.client.EditPanel",{
    extend:'Ext.window.Window',
    alias:'widget.clientedit',
    width:320,
    height:400,
    renderTo:Ext.getBody(),
    modal:true,
    resizable:true,
    layout: 'fit',
    bodyStyle:'background-color:white;background-image:none',
    title:'信息编辑',
    items:[{
        xtype:'form',
        width:310,
        height:350,
        border:false,
            autoScroll:true,
		    fieldDefaults: {
		            labelAlign: 'right',
		            labelWidth: 100,
		            msgTarget: 'under'
		    },
		    defaultType: 'textfield',
		    defaults:{
		        margin:"10 0 0 5",
		        width:250
		    },
		    items:[{
		            name:'id',
		            disabled:false,
		            hidden:true,
		            id:'clientid'
		        },{
		            itemId:'Edit0',
		            name:'name',
		            fieldLabel:'客户名称',
		            allowBlank: false,
		            blankText:'必须填写客户名称！',
		            emptyText: '必填项'
		        },{
		            itemId:'Edit1',
		            name:'address',
		            fieldLabel:'公司地址',
		            allowBlank: true,
		            emptyText: '例如：XX省XX市XX区XX街XX号'
		        },{
		            itemId:'Edit2',
		            name:'contact',
		            fieldLabel:'客户联系人*',
		            blankText:'必须填写联系人名称！',
		            allowBlank: false,
		            emptyText: '必填项'
		        },{
		            itemId:'Edit3',
		            name:'phone',
		            fieldLabel:'客户移动电话*',
		             regex: /^(13[0-9]|15[0|3|6|8|9]|18[0|5|6|8|9])\d{8}$/,
		             regexText: "不能识别的<font color = red>移动电话</font>",
		             blankText:'必须填写联系人电话！',
		             allowBlank: false,
		             emptyText: '必填项'
		        },{
		            fieldLabel:'客户联系邮箱',
		            itemId:'Edit4',
		            name:'email',
		            regex: /^([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/,
		            regexText:'不能识别的邮箱地址',
		            allowBlank: true,
		            emptyText: '例如：username@extample.com'
		        },{
		            itemId:'Edit5',
		            name:'fax',
		            fieldLabel:'客户传真(固话)',
		            regex: /^0(\d{2}|\d{3})\-(\d{7}|\d{8})$/,
		            regexText: "不能识别的<font color = red>传真/固话</font>",
		            allowBlank: true,
		            emptyText: '例如：000-0000000'
		        },{
		            itemId:'Edit6',
		            name:'qq',
		            fieldLabel:'客户QQ',
		            regex:/[0-9]?/,
		            regexText: "不能识别的QQ号码！"
		        }],
		    buttons:[{
		            text:'完成',
		            action:'com',
		            id:'com'
		        },{
                    text:'取消',
                    action:'cancel'
                }]
	        }]
    
})